
{template 'common/header'}
{php load()->func('tpl')}
{if $op== 'display'}
<ul class="nav nav-tabs">
	<li {if $op == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('navExtension', array('op' => 'display'))}">导航扩展管理</a></li>
	<li {if $op == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('navExtension', array('op' => 'post'))}">导航扩展添加</a></li>
</ul>
<div class="main">
<div style="margin:0;" class="alert alert-info"><i class="icon-warning-sign"></i>&nbsp;主界面下可自定义多个导航,方便用户集成第三方模块。</div>
	<!-- <form class="form-horizontal form" action="" method="post" onsubmit="return formcheck(this)">
		<input name="weid" type="hidden" value="{$weid}"> -->
		<!-- <h4>导航扩展管理</h4> -->
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th class="row-hover span2">导航名称<i></i></th>
					<th class="row-hover span2">第三方网址<i></i></th>
					<th class="row-hover span2">说明<i></i></th>
					<th class="row-hover" style="min-width:370px;">操作</th>
					<th class="row-hover span1" style="text-align:right;width:100px;"></th>
				</tr>
			</thead>
			<tbody id="status-items">
			{loop $list $item}
				<tr>
					<td>{$item['title']}</td>
					<td>{$item['navurl']}</td>
					<td>{$item['content']}</td>
					<td>
						<span>
							<a href="{php echo $this->createWebUrl('navextension',array('op'=>'post','id'=>$item['id']))}">编辑</a>
							<a href="{php echo $this->createWebUrl('navextension',array('op'=>'delete','id'=>$item['id']))}" onclick="return confirm('此操作不可恢复，确认吗？');">删除</a>
						</span>
					</td>
				</tr>
			{/loop}
			</tbody>
			<!-- <tr>
				<td colspan="6">
					<a href="javascript:;" onclick="addStatusItem()"><i class="icon-plus-sign-alt"></i> 添加新导航</a>
				</td>
			</tr> -->
		</table>
		<!-- <table class="tb">
			<tr>
				<td colspan="6">
					<button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
					<input type="hidden" name="token" value="{$_W['token']}" />
				</td>
			</tr>
		</table> -->
<!-- 	</form> -->
{$pager}
</div>
{elseif $op == 'post'}
<ul class="nav nav-tabs">
	<li {if $op == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('navExtension', array('op' => 'display'))}">导航扩展管理</a></li>
	<li {if $op == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('navExtension', array('op' => 'post'))}">导航扩展添加</a></li>
</ul>

<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data">
		<input type="hidden" name="id" value="{$item['id']}">
		<div class="panel panel-default">
		  <div class="panel-heading">
		    <h3 class="panel-title">导航扩展添加</h3>
		  </div>
		  <div class="panel-body">
		     <div class="form-group">
			    <label for="" class="col-sm-2 control-label">所属分类</label>
			    <div class="col-xs-4">
			      <select name='cate' class='form-control'> 
						<option value='1' {if $item['cate'] == 1}selected{/if}>物业服务</option>
						<option value='2' {if $item['cate'] == 2}selected{/if}>小区互动</option>
						<option value='3' {if $item['cate'] == 3}selected{/if}>生活服务</option>
					</select>
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="title" class="col-sm-2 control-label">导航名称</label>
			    <div class="col-xs-4">
			      <input type="text" name="title" id='title' value="{$item['title']}" class="form-control" placeHolder="请输入主界面导航名称"/>
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="title" class="col-sm-2 control-label">第三方网址</label>
			    <div class="col-xs-4">
			      {php echo tpl_form_field_link(navurl,$item['navurl'])}
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="title" class="col-sm-2 control-label">系统图标</label>
			    <div class="col-xs-10">
			      {php echo tpl_form_field_icon(icon,$item['icon'])}
	            <span class="help-block">导航的背景图标，系统提供丰富的图标ICON。</span>
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="title" class="col-sm-2 control-label">背景颜色</label>
			    <div class="col-xs-10">
			      {php echo tpl_form_field_color(bgcolor,$item['bgcolor'])}
	              <span class="help-block">导航的背景颜色。</span>
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="content" class="col-sm-2 control-label">说明</label>
			    <div class="col-xs-4">
			      <input type="text" name="content" id='content' value="{$item['content']}" class="form-control" placeHolder="请输主界面导航说明"/>
			    </div>
			 </div>
			 <div class="form-group">
			    <label for="" class="col-sm-2 control-label"></label>
			    <div class="col-xs-4">
			      <button type="submit" class="btn btn-primary span3" name="submit" value="提交">提交</button>
				<input type="hidden" name="token" value="{$_W['token']}" />
			    </div>
			 </div>
		  </div>
		</div>
	</form>
{/if}
{template 'common/footer'}